package com.ronin.pkimg.control;


import com.ronin.pkimg.bean.QiniuTokenResp;
import com.ronin.pkimg.service.TaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.concurrent.ListenableFuture;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UpTokenControl {

    @Autowired
    private TaskService taskService;

    @Async
    @GetMapping(value = "/token")
    public ListenableFuture<QiniuTokenResp> getToken() {
        return taskService.execGetToken();
    }

}
